ISCPersistenceUnit::ApplyDataVault

Here is the signature for the ApplyDataVault function:

HRESULT ApplyDataVault([in]ISCPropertyBag * PropertyBag,
[in] VARIANT strModelPath,
[in] VARIANT strCSVPath);

The following table contains the valid arguments for the ApplyDataVault function:

Parameter

Valid Type/Value

Description

PropertyBag

ISCPropertyBag * - Pointer to a Property Bag object

Contains the model on which Data Vault properties should be applied

strModelPath

VT_BSTR

Specifies the full path of the model

strCSVPath

VT_BSTR

Specifies the path of the CSV file

The CSV file mentioned in the table above follows this format for example:

Entity

Component

Customer

Hub

Cust_Sales

Link

Customer_Info

Satellite

Customer_Address

Reference

Sales

Hub

Sales_Employees

Link

Employee

Hub

Employee_Info

Satellite

Record_PointInTime

PIT

Record_Bridge

Bridge

Apply Data Vault Sample Script:

Dim oAPI
Set oAPI = CreateObject("ERwin9.SCAPI.9.0")
Dim oPropertyBag
Set oPropertyBag = CreateObject("ERwin9.SCAPI.PropertyBag.9.0")
'Create Persistence Unit
Dim oPUnitCol
Set oPUnitCol = oApi.PersistenceUnits
'Create Propertybag
Dim oPersistenceUnit
Set oPersistenceUnit = oPUnitCol.Create(oPropertyBag)
'Open the model
Set oPersistenceUnit = oApi.PersistenceUnits.Add("C:\Users\Administrator\Desktop\CSV\sample.erwin")
'Call the API with Property Bag, model, and CSV file path
Call oPersistenceUnit.ApplyDataVault(oPropertyBag, "C:\Users\Administrator\Desktop\CSV\sample.erwin", 
"C:\Users\Administrator\Desktop\CSV\samplecsv.csv")
'Save the model
Call oPersistenceUnit.Save("C:\Temp\SampleDataVault.erwin", "OVF=Yes")

 

Do not skip the following line from the above script:

oApi.PersistenceUnits.Add("C:\Users\Administrator\Desktop\CSV\sample.erwin")